#!/usr/bin/env bash


###
#  交叉编译脚本: 效率比较慢,推荐使用 .goreleaser进行编译
#
###
GOOSS=(windows darwin linux)
GOARCHS=(386 amd64)


for goos in ${GOOSS[@]}
do
    for goarch in ${GOARCHS[@]}
    do
        # echo $goos - $goarch
        # echo CGO_ENABLED=0 GOOS=$goos GOARCH=$goarch go build ${*:-.}
        CGO_ENABLED=0 GOOS=$goos GOARCH=$goarch go build -o dist/${goos}_${goarch} ${*:-.}
    done
done
